UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GDtkUowbtJ/QTvxTIv67NtWPL7O3PrBRZ4JiB2E8m5c='
WHERE
key_id = '245fe0f13fe3eede82655b6eef16a9343df474574bef83d7a15443205c440caa'
AND (
token = 'GDtkUowbtJ/QTvxTIv67NtWPL7O3PrBRZ4JiB2E8m5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)