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