UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HN9Hei+/k2QFchDi3hjnaPNq3eXjPmZPTesBw5iomkQ=' 
WHERE 
  key_id = '61c89d134ea9b9bc2415e268a86c8508b62e905cf21c587ebc6ba397fa9826c9' 
  AND (
    token = 'HN9Hei+/k2QFchDi3hjnaPNq3eXjPmZPTesBw5iomkQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025