UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x9y0pQcZ6p1tZSCaRMuQGJtuV+KVglqV9OQJ2t/9yKs=' 
WHERE 
  key_id = 'e256489c9011edb4cb538f56c79f64780d64536962ec863244a8deef451d9ebc' 
  AND (
    token = 'x9y0pQcZ6p1tZSCaRMuQGJtuV+KVglqV9OQJ2t/9yKs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00062