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

Query time 0.00044