UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6wDpeh2AddP8MEO13oVfxJru/YCUts6DqBR8YA5lLVQ='
WHERE
key_id = 'cb4117536674fa38640b8a6f0d93b7104516d9b5d874e581c0dc6ee9043fd0cd'
AND (
token = '6wDpeh2AddP8MEO13oVfxJru/YCUts6DqBR8YA5lLVQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)