UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'jph/reFXvkun3KZzolRlmu5uZVDc1Zx4YuBIygyZDqM=' 
WHERE 
  key_id = '9314e7eea0ed17b5d6e88625d451496c151cbecce0d4a5f4e251b7c6da850a67' 
  AND (
    token = 'jph/reFXvkun3KZzolRlmu5uZVDc1Zx4YuBIygyZDqM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025