UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OkIYJuTzpxLXQziwHqL0pegF1VC2gPT7HOee0dOVJK0='
WHERE
key_id = 'cc6c2b1341ab0ba18ed7d5ab51635a01c1a2ca3b8ad7893bd50c6b8a2b534097'
AND (
token = 'OkIYJuTzpxLXQziwHqL0pegF1VC2gPT7HOee0dOVJK0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)