UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kTURipEKPMJYlpq6L9QzbkuBoYB/VX9tGF7ClHmNiAY=' 
WHERE 
  key_id = 'df9d52b349a923da6d0533686ff0c8054ae42e31f57fb202e7b2df3cb4ae2a6c' 
  AND (
    token = 'kTURipEKPMJYlpq6L9QzbkuBoYB/VX9tGF7ClHmNiAY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028