UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'qBXcUJ8aTiUlsbl5BxxlIncvVL4KKcuhIt3lDJ/ac6Y=' 
WHERE 
  key_id = 'b295e1ac4f43442c5dbef129fa0c44a951b439043e3ed4c4f82ed8ad670b87b7' 
  AND (
    token = 'qBXcUJ8aTiUlsbl5BxxlIncvVL4KKcuhIt3lDJ/ac6Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00024