UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ghG6mLkEYtd7gU9kclRUJuqFihLaG93AGEu2w8mEEJ8=' 
WHERE 
  key_id = '626cad216566e0e31e23cbf416e5c8d428d4960f48052dcde39e50ca2106b693' 
  AND (
    token = 'ghG6mLkEYtd7gU9kclRUJuqFihLaG93AGEu2w8mEEJ8=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023