UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sRpk5kp/1L1sz0RDGQVCeDoqzoNGImiWhL0TrdXZkvg='
WHERE
key_id = '923e97da0264925d35b3c5b2f58eca38a9dae9fdf3196287ed0a5eb2c0d14466'
AND (
token = 'sRpk5kp/1L1sz0RDGQVCeDoqzoNGImiWhL0TrdXZkvg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)