UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'xvBgF4w/YifuEcyKaSts5Tku2i80NFukZX7iKPe+5TU=' 
WHERE 
  key_id = 'd973f5c8f8b374c16fbc210b23ee917da58196c7fe85797ca07e3f946cc0096b' 
  AND (
    token = 'xvBgF4w/YifuEcyKaSts5Tku2i80NFukZX7iKPe+5TU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038