UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ijz63royIQUsxT8TwZtYcsuhcJShjUBbjJjmJRo6trE='
WHERE
key_id = '01f7865d0c05279f674b37661e218af918cb69225df0217dd1f7f033e5c00232'
AND (
token = 'Ijz63royIQUsxT8TwZtYcsuhcJShjUBbjJjmJRo6trE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)