UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hTJw6ssNEJ8WH5z5AY+NkhV5s7FKax94U7sntgXofeY='
WHERE
key_id = 'b3f632b64f683b15e0e700ec32fe27bd512365f03306a2544426acc2cb8dbae8'
AND (
token = 'hTJw6ssNEJ8WH5z5AY+NkhV5s7FKax94U7sntgXofeY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)