UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'q+oBzD3rVSVXR42A6hRNvH0BIsIlZZ6OcxLKLF7RXHA=' 
WHERE 
  key_id = '4710cb24b61d25dd3a85b8f6b5cb2e381ad126366ec7e31e0cb6f9141c82aac4' 
  AND (
    token = 'q+oBzD3rVSVXR42A6hRNvH0BIsIlZZ6OcxLKLF7RXHA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032