UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '7ZuVBJWN8qunjtrT07hLQ9//5XpF6gmW6QA+1CQRHBY=' 
WHERE 
  key_id = '2285a109d6e0f70a87a7f56daecce8bd6b1c4335918b593709d72dbbd8d2fc45' 
  AND (
    token = '7ZuVBJWN8qunjtrT07hLQ9//5XpF6gmW6QA+1CQRHBY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031