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