UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H8x4S9XRyJBuh03VgFyI7wBtM3VB4JOGSe54uknzQsI=' 
WHERE 
  key_id = '69ccaed95f821d844cacd3e311059626e111d88205d04cb5ba569106266c093c' 
  AND (
    token = 'H8x4S9XRyJBuh03VgFyI7wBtM3VB4JOGSe54uknzQsI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033