UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lzV9vshI1xvmB7+k/JtslifUPmvv10nxF+Er8lyvrwg='
WHERE
key_id = '2384f44dd1ff34081f933eea9e9e28ccabce3f9445347c74613abc6da25f8da0'
AND (
token = 'lzV9vshI1xvmB7+k/JtslifUPmvv10nxF+Er8lyvrwg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)