UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'CrW9tCV5CO4M/8Q7Dh4EY6ew8ML9lfJOVZTBnaFwgGI='
WHERE
key_id = '0d0bebbd8cded3f8aadbf10c8bf3995e501d1db34804367f257cb8d5ab51ef2e'
AND (
token = 'CrW9tCV5CO4M/8Q7Dh4EY6ew8ML9lfJOVZTBnaFwgGI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)