UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'L6vAguRahiir8j/cTqVZrZkbhsQVFS/xNge6qyy5D7k='
WHERE
key_id = '7cbc613c01415b4bd266bb5fb87a404ffbfe0ad052fc60a214ad757e94c94372'
AND (
token = 'L6vAguRahiir8j/cTqVZrZkbhsQVFS/xNge6qyy5D7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)