UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ue6BDRlhd4WDkrgU9NYZKnxS15U5sK7LLNX1SP99sqE='
WHERE
key_id = '601d62be6adef027f463ccfa31eeb34bb9364e8494d95c014a839f89a8f2b0ae'
AND (
token = 'ue6BDRlhd4WDkrgU9NYZKnxS15U5sK7LLNX1SP99sqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)