UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Oj9ape4mvT38YGf5CqL7wR0ECSn5iIGmcLE3RV25RZE='
WHERE
key_id = '037450156d9430d4b44ac73cbae240fa8ecf3c1115a0d0795c95721f21fe5ae1'
AND (
token = 'Oj9ape4mvT38YGf5CqL7wR0ECSn5iIGmcLE3RV25RZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)