UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'QRR3H+Im2ZkL9m/KjvyCs8Vy0LJbdmE+1/WRC70hxQY=' 
WHERE 
  key_id = '62ee9e7dde4e27daf0a6af0c7965fc0076f22a9fa785784de45aac7d88515c81' 
  AND (
    token = 'QRR3H+Im2ZkL9m/KjvyCs8Vy0LJbdmE+1/WRC70hxQY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032