UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'l0Qg8XHG/oC0zxyOtgVfMwqG77PQBD+ieuEtqEXGknI='
WHERE
key_id = 'aedff7aa6fec170eaabbeae432f7496be66f7b401f082f47e0c43908cdd792dd'
AND (
token = 'l0Qg8XHG/oC0zxyOtgVfMwqG77PQBD+ieuEtqEXGknI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)