UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'rU6XhYud5BlYp0iM3J2HbbaOa3CfdVpZUnk/4iv7Gjs='
WHERE
key_id = '12fa55822730526b2ac0f4b037a10bcf6ee7f3e3639a1f1fd24e4effed7762c0'
AND (
token = 'rU6XhYud5BlYp0iM3J2HbbaOa3CfdVpZUnk/4iv7Gjs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)