UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dx6LF+eTUJ0N/81sqkf4rZjTxYbOiqxK1S8xZYg5kps='
WHERE
key_id = 'b60eec23320c7a287ac1597e33023c33dfe0055537701a690834365e9e068820'
AND (
token = 'dx6LF+eTUJ0N/81sqkf4rZjTxYbOiqxK1S8xZYg5kps='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)