UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'cVOpvTNSWH+Ux51Ta+bZtor0mnq1lyDVGoIIKoEP9LM='
WHERE
key_id = '1a45f564f52151f40e7d9240a9db4d0536b861a7d2c4da227816337ce710bad4'
AND (
token = 'cVOpvTNSWH+Ux51Ta+bZtor0mnq1lyDVGoIIKoEP9LM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)