UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'autqLt6xtjE89Xc/vDEsY0WqT5a0cftKwbdt1xGrGqw=' 
WHERE 
  key_id = '64806f7c9a38efbdd7286ca0053543c983e1b875d64746c77754b3fa869b4ff1' 
  AND (
    token = 'autqLt6xtjE89Xc/vDEsY0WqT5a0cftKwbdt1xGrGqw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00016