UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'x05jN2TswoI1bPEdg+QUZoIrxyKjHQoNh5IdMUU4ia0=' 
WHERE 
  key_id = '8a23eff05f165d423f06181cfd56b1faf3cd8ff87c08bddbcdd7e380a285c7e0' 
  AND (
    token = 'x05jN2TswoI1bPEdg+QUZoIrxyKjHQoNh5IdMUU4ia0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00015