UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2SZE2lU6V5TOo5PJW71c7ryIyHau2FweIvuW63kgvsg='
WHERE
key_id = '98a596c45ca77c7aebb33841bb36c1612a78676fd6a936ecf0772356502f1818'
AND (
token = '2SZE2lU6V5TOo5PJW71c7ryIyHau2FweIvuW63kgvsg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)