UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'SzkIIFHCi3P+ZU9g5zWrWyP2iPfhHZcLDJ0yn+llNLQ=' 
WHERE 
  key_id = '3e999484845252e67c9367e42cbb61b8a2ba50668118d8b09974f682ca8f1c71' 
  AND (
    token = 'SzkIIFHCi3P+ZU9g5zWrWyP2iPfhHZcLDJ0yn+llNLQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00056