UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Hk4XsVXu3h04oVXE8YxEFIwZzkGtTErGVIUlraiaFSE='
WHERE
key_id = '76069cae02dc06997625cf62311533dfb6f2e852d83f958ea0ea8d3ead36f994'
AND (
token = 'Hk4XsVXu3h04oVXE8YxEFIwZzkGtTErGVIUlraiaFSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)