UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2Fmr734SjlklxarrxFZR0NHsIzBvL1X0F/5Tatyq1vM='
WHERE
key_id = 'e97f21b95992d408481967ed679c2432a5cd805ab03f59ebb9c1e0180b992f0b'
AND (
token = '2Fmr734SjlklxarrxFZR0NHsIzBvL1X0F/5Tatyq1vM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)