UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5fYDfbakbHUOj6HUuqN3Aj2VS90eB9CROnOdUqJJ9q0='
WHERE
key_id = 'aa52de8a30f58a4c37600152aaec58116b28faa77d00db838ff945f8d7ab8621'
AND (
token = '5fYDfbakbHUOj6HUuqN3Aj2VS90eB9CROnOdUqJJ9q0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)