UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'QdoWkTHB3VLomgaTSX/Xr7CbLtO1wgqL6sjAaCDjKrM='
WHERE
key_id = 'd771cc007ae63c98908382e2dcda6b4ad6703bd9a0c89642812339b314a52c1d'
AND (
token = 'QdoWkTHB3VLomgaTSX/Xr7CbLtO1wgqL6sjAaCDjKrM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)